package org.jeecg.modules.paycenter.controller;

import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.paycenter.dto.BankCfgDto;
import org.jeecg.modules.paycenter.enums.PayChannelEnum;
import org.jeecg.modules.paycenter.service.PayCenterService;
import org.jeecg.modules.wlhy.hyconfig.entity.HyConfig;
import org.jeecg.modules.wlhy.utils.HyCfgUtil;
import org.jeecg.modules.wlhy.utils.HyConfigUtils;
import org.jeecg.modules.wlhy.walletcfg.entity.HyWalletCfg;
import org.jeecg.modules.wlhy.walletcfg.service.IHyWalletCfgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/paycenter")
@Slf4j
public class HyPayCenterController extends JeecgController<HyWalletCfg, IHyWalletCfgService> {

    @Autowired
    private PayCenterService payCenterService;

    //region 获取配置

//    @ApiOperation(value = "钱包配置列表", notes = "钱包配置列表")
//    @GetMapping(value = "/wallet/cfg")
//    public Result<?> cfg() {
//        HyConfig config = HyConfigUtils.getConfig();
//        Map<String, Object> data = new HashMap<>();
//        data.put("nhST", config.getNhbankIzUse() ? "1" : "0");
//        data.put("sysST", "1");
//        data.put("pfST", config.getPfIzUse() ? "1" : "0");
//        data.put("tlST", HyCfgUtil.isTongLianUsed() ? "1" : "0");
//        return Result.OK(data);
//    }

    @ApiOperation(value = "平台钱包配置列表", notes = "平台钱包配置列表")
    @GetMapping(value = "/cfg/ptlist")
    public Result<?> ptlist() {
        List<BankCfgDto> list = payCenterService.getPtAccountCfgList();
        return Result.OK(list);
    }

    //endregion
}
